import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';

export default async function a003(fd: IFeidaoAiBrowserComponent) {

	// 左新增数据
	const risk_po_type_name = fd.data.node.querySelector<HTMLInputElement>('[data-name="risk_po_type_name"]').value;
	if (!risk_po_type_name) {
		alert('请输入风险点类型名称：');
		return;
	}
	const risk_level = fd.data.node.querySelector<HTMLOptionElement>('[data-name="risk_level"]').value;
	if (!risk_level) {
		alert('请输入风险等级：');
		return;
	}
	console.log('风险等级=》', risk_level);

	const res = await nodejs<{ code: number; result: string; }>('risk_point/zj-000006/s002', {
		filter: {
			risk_po_type_name,
			risk_level
		}
	});

	console.log("neirong==>", res);

	if (res.code === 1) {
		alert('保存成功');
		// window.location.reload();
	} else {
		alert('保存失败');
	}
}
